package dq.study.designmodel.proxy.statics;

import dq.study.designmodel.proxy.Tank;

/**
 * 静态代理--继承方式
 *
 * @author dongqun
 * @date 2019/3/30 22:26
 */
public class InheritProxyTank extends Tank {
    /**
     * @Description: 当有新的需求时只能新建代理（eg 调整日志和调用时间顺序），无法扩展
     * @author dongqun
     * @date 2019/3/30 22:29
     * @version
     */
    @Override
    public void move() {
        System.out.println("start moveing......");
        long start = System.currentTimeMillis();
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        super.move();
        long end = System.currentTimeMillis();
        System.out.println("consume time is:" + (end - start) + "毫秒");
        System.out.println("end moving......");
    }
}
